package org.huang.sample15.controller

import spock.lang.*

class DeptTestDemoTest extends Specification {

    DeptTestDemo demo = new DeptTestDemo();

    @Unroll
    def testPrivateHello() {
        expect:
        rs == demo.hello(a, b)

        where:
        a   | b   | rs
        '1' | '2' | 'hello,12'
        '2' | '2' | 'hello,22'
        '4' | '2' | 'hello,42'

    }


    @Unroll
    def testPrivateTest() {
        given:
        demo.hello(a, b) >> 'A'


        when:
        def rs = demo.test(a, b)

        then:
        result == rs

        where:
        a << ['1', '2', '3']
        b << ['2', '2', '2']
        result << ['hello,12!', 'hello,22!', 'hello,32!']
    }


    def testAdd() {
        given: "前置条件"
        def a = 10
        def b = 20
        expect:
        20 == Math.max(a, b)
    }
}

//Generated with love by TestMe :) Please report issues and submit feature requests at: http://weirddev.com/forum#!/testme